package ui.juego

import dominio.investigacion.CarmenSanDiego
import org.uqbar.arena.layout.HorizontalLayout
import org.uqbar.arena.widgets.Button
import org.uqbar.arena.widgets.Panel
import org.uqbar.arena.windows.SimpleWindow
import org.uqbar.arena.windows.WindowOwner
import ui.juego.mapamundi.MapamundiWindow
import ui.juego.utilidades.IconUtils
import ui.juego.expedientes.ExpedientesConEdicionWindow
import java.awt.Color
import org.uqbar.arena.widgets.Label
import dominio.factory.FactoryGame

class CarmenSanDiegoWindow extends SimpleWindow<CarmenSanDiego> {
	
	@Property FactoryGame factory = new FactoryGame
	
	new(WindowOwner parent, CarmenSanDiego model) {
		super(parent, model)
		title = "¿Dónde está Carmen Sandiego?"
		iconImage = IconUtils.path
	}
	
	override protected addActions(Panel actionsPanel) {}
	
	override protected createFormPanel(Panel mainPanel) {}

	override createMainTemplate(Panel mainPanel) {
	
		new Label(mainPanel) => [
			text = "¿Qué haremos ahora detective?"
			fontSize = 12
			foreground = Color.WHITE
			background = Color.ORANGE
		] 		
		val startPanel = new Panel(mainPanel) => [
			layout = new HorizontalLayout
		]
		
		new Button(startPanel) => [
			caption = "Resolver Misterio"
			onClick [ |
				close
				new AceptarCasoWindow(this, factory.caso).open
			]
		] 
		
		new Button(startPanel) => [
			caption = "Expedientes"
			onClick [ |
				new ExpedientesConEdicionWindow(this, factory.expedientes).open
			]
		] 
		
		new Button(startPanel) => [
			caption = "Mapamundi"
			onClick [ |
				new MapamundiWindow(this, factory.mapamundi).open
			]
		] 
		
	}
	
	
}